#include <QtGui>
#include <QTranslator>
#include <QtCore/QTextCodec>
#include "gv_systemtransmitterssetupdialog.h"
#include "gv_systemtransmittershomedialog.h"
#include "gv_systemtransmittersconfigurationdialog.h"
#include "gv_systemtransmittersconfigurationinputdialog.h"
#include "gv_home.h"
#include "gv_setting.h"

extern GV_Setting *gvsetting;
extern QDialog  *dialog;
GV_SystemTransmittersConfigurationDialog::GV_SystemTransmittersConfigurationDialog(QWidget *parent)
       : QDialog(parent)
{
    setupUi(this);

    QTranslator translator;
    translator.load(gvsetting->GV_GetLanguage(),".");
    qApp->installTranslator(&translator);
    reloadtext();


    //AnalogueCurrenLabel->setText(QString::number(0));

    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));

    timer = new QTimer;
    connect(timer,SIGNAL(timeout()),this,SLOT(GV_chTime()));
    connect(HelpButton,SIGNAL(clicked()),this,SLOT(helpclicked()));
    connect(CancelButton,SIGNAL(clicked()),this,SLOT(cancelclicked()));
    connect(BackButton,SIGNAL(clicked()),this,SLOT(backclicked()));
    connect(TransmittersButton,SIGNAL(clicked()),this,SLOT(transmittersclicked()));
    connect(SetupButton,SIGNAL(clicked()),this,SLOT(setupclicked()));

    timer->start(1000);
}
void GV_SystemTransmittersConfigurationDialog::reloadtext()
{
    //NameHintsLabel->setText(tr("Zones"));
}
void GV_SystemTransmittersConfigurationDialog::GV_chTime()
{
    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));
}

void GV_SystemTransmittersConfigurationDialog::helpclicked()
{
    QDialog *dialog1 = new GV_SystemTransmittersHomeDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}

void GV_SystemTransmittersConfigurationDialog::backclicked()
{
    QDialog *dialog1 = new GV_SystemTransmittersHomeDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}

void GV_SystemTransmittersConfigurationDialog::transmittersclicked()
{
    QDialog *dialog1 = new GV_SystemTransmittersConfigurationInputDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}

void GV_SystemTransmittersConfigurationDialog::cancelclicked()
{
    QDialog *dialog1 = new GV_SystemTransmittersHomeDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}

void GV_SystemTransmittersConfigurationDialog::setupclicked()
{
    QDialog *dialog1 = new GV_SystemTransmittersSetupDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}
